package io;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class ReadStringDemo01 {
    public static void main(String[] args) throws IOException {
//        File file = new File("f1.txt");
//        long size = file.length();
//        FileInputStream fis = new FileInputStream(file);

        FileInputStream fis = new FileInputStream("f1.txt");

//        byte[] data = new byte[(int)size];
        byte[] data = new byte[fis.available()];
        int len = fis.read(data);

        String str = new String(data,0,len);
        System.out.println(str);

        fis.close();
    }
}
